package com.bharatonjava.stump.web;

import java.util.List;

import com.bharatonjava.stump.domain.Employee;
import com.bharatonjava.stump.service.EmployeeService;


public class EmployeeBean {

	private Employee employee;
	private List<Employee> employees;
	private EmployeeService employeeService;
	
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	
	public Employee getEmployee() {
		return employee;
	}

	public List<Employee> getEmployees() {
		return employees;
	}
	
	public void setEmployees(List<Employee> employees) {
		this.employees = employees;
	}
	
	public EmployeeService getEmployeeService() {
		return employeeService;
	}
	
	public void setEmployeeService(EmployeeService employeeService) {
		this.employeeService = employeeService;
	}
	
	public EmployeeBean() {
		employee = new Employee();
	}
	
	public String saveEmployee(){
		employeeService.saveEmployee(employee);
		
		return "";
	}
	
	public void resetEmployeeForm(){
		employee = new Employee();
	}
	
	public void getAllEmployees(){
		employees = employeeService.getEmployees();
		System.out.println(employees);
	}
}
